<template>
  <div>
    <button @click="componentId = 'Count'">Count</button>
    <button @click="componentId = 'Movie'">Movie</button>
    <keep-alive>
      <component :is="componentId"></component>
    </keep-alive>
  </div>
</template>

<script>
  import Count from "./components/Count";
  import Movie from "./components/Movie";
  export default {
    name: "App",
    components: {
      Count,
      Movie,
    },
    data() {
      return {
        componentId: Count,
      };
    },
  };
</script>

<style></style>
